/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package plan;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Vector;
import turnover.Consumption;

/**
 *
 * @author Alejandro
 */
public class Plan {

    private String name;
    private List<String> savesNoCompatibles;

    public Plan(){
        this.savesNoCompatibles = new LinkedList();
    }

    public double getCost(Consumption consumption){
        return 0;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List getSavesNoCompatibles() {
        return savesNoCompatibles;
    }

    public boolean isCompatible(Vector v){
        boolean b = true;
        Iterator it = v.iterator();
        while(it.hasNext() && b){
            String s = (String)it.next();
            if(this.savesNoCompatibles.contains(s)){
                b = false;
            }
        }
        return b;
    }

    @Override
    public Object clone(){
        Plan clone = new Plan();
        clone.name = this.name;
        Iterator it = this.savesNoCompatibles.iterator();
        while(it.hasNext()){
            clone.savesNoCompatibles.add((String)it.next());
        }
        return clone;
    }
}
